package com.zou.mall.member.feign;

import com.zou.common.to.CategoryTo;
import com.zou.common.utils.R;
import com.zou.mall.member.fallback.CategoryFeignServiceFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "mall-product",fallback = CategoryFeignServiceFallBack.class
        ,configuration = CategoryFeignServiceFallBack.class)
public interface CategoryFeignService {

    @GetMapping("/product/category/list/trees")
    R listTree2();


    /**
     * @RequestMapping("/save")
     * public R save(@RequestBody CategoryEntity category){
     * @param to
     * @return
     *
     * 只要json数据兼容，双方服务无需使用同一个to
     */
    @PostMapping("/product/category/save")
    R save(@RequestBody CategoryTo to);
}
